package com.dbb.trade.entity;

import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.OneToOne;
import javax.persistence.Table;


@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(
    name="filetype",
    discriminatorType=DiscriminatorType.STRING
)
@DiscriminatorValue("base")
@Table(name = "COMMENTS")
public class Comment extends IdEntity {
	
	private String comment;
	private Comment enComment;
	
	public Comment() { }
	
	public Comment(String comment) {
		this.comment = comment;
	}
	
	public Comment(String comment, String enComment) {
		this.comment = comment;
		this.enComment = new Comment(enComment);
	}
	
	@Lob
	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	@OneToOne
	@JoinColumn(name="en_id")
	public Comment getEnComment() {
		return enComment;
	}

	public void setEnComment(Comment enComment) {
		this.enComment = enComment;
	}
	
}
